//导入vue
import Vue from "vue";
import VueRouter from 'vue-router';
//导入组件
import main from "../views/main";
import register from "../views/register";
import login from "../views/login";
import userinfo from "../views/userinfo";
import mycontrol from "../views/mycontrol";
import myvideo from "../views/myvideo";
//安装路由
Vue.use(VueRouter);

//配置导出路由
export default new VueRouter({
  mode:"history",
  routes: [
    {
      path:"/",
      redirect :'/login'
    },
    {
      path: "/login",
      name: "login",
      component: login
    },
    {
      //路由路径
      path: '/register',
      name: 'register',
      //跳转的组件
      component:register
    },
    {
      //路由路径
      path: '/main',
      name: 'main',
      //跳转的组件
      component:main
    },
    {
      //路由路径
      path: '/userinfo',
      name: 'userinfo',
      //跳转的组件
      component:userinfo
    },
    {
      //路由路径
      path: '/mycontrol',
      name: 'mycontrol',
      //跳转的组件
      component:mycontrol
    },
    {
      path: '/myvideo',
      name: 'myvideo',
      component: myvideo
    }
  ]
})
